import request from '@/utils/request.js'

export const getUserChannelAPI = () => {
  return request.get('/v1_0/user/channels')
}

// 获取列表内容
export const getArtListAPI = (id) => {
  return request.get('/v1_1/articles', {
    params: {
      channel_id: id,
      timestamp: Date.now(),
      with_top: 1
    }
  })
}
// 设置不喜欢的文章
export const dislikeArtticleAPI = (id) => {
  return request.post('/v1_0/article/dislikes', { target: id })
}
// 举报文章接口
export const reportArtticleAPI = (id, type) => {
  return request.post('/v1_0/article/reports', { target: id, type })
}
// 获取所有频道的接口
export const getAllChannelsAPI = () => {
  return request.get('/v1_0/channels')
}
// 更新用户勾选的频道列表
export const updateChannelAPI = (channelArry) => {
  return request.put('/v1_0/user/channels', { channels: channelArry })
}
